Optimal. Leaf size=113 \[ \frac {B (b c-a d)^2 n x}{3 d^2}-\frac {B (b c-a d) n (a+b x)^2}{6 b d}-\frac {B (b c-a d)^3 n \log (c+d x)}{3 b d^3}+\frac {(a+b x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{3 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 113, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {2548, 45}
\begin {gather*} \frac {(a+b x)^3 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{3 b}-\frac {B n (b c-a d)^3 \log (c+d x)}{3 b d^3}+\frac {B n x (b c-a d)^2}{3 d^2}-\frac {B n (a+b x)^2 (b c-a d)}{6 b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 2548
Rubi steps
\begin {align*} \int (a+b x)^2 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx &=\int \left (A (a+b x)^2+B (a+b x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx\\ &=\frac {A (a+b x)^3}{3 b}+B \int (a+b x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \, dx\\ &=\frac {A (a+b x)^3}{3 b}+\frac {B (a+b x)^3 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 b}-\frac {(B (b c-a d) n) \int \frac {(a+b x)^2}{c+d x} \, dx}{3 b}\\ &=\frac {A (a+b x)^3}{3 b}+\frac {B (a+b x)^3 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 b}-\frac {(B (b c-a d) n) \int \left (-\frac {b (b c-a d)}{d^2}+\frac {b (a+b x)}{d}+\frac {(-b c+a d)^2}{d^2 (c+d x)}\right ) \, dx}{3 b}\\ &=\frac {B (b c-a d)^2 n x}{3 d^2}-\frac {B (b c-a d) n (a+b x)^2}{6 b d}+\frac {A (a+b x)^3}{3 b}-\frac {B (b c-a d)^3 n \log (c+d x)}{3 b d^3}+\frac {B (a+b x)^3 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 171, normalized size = 1.51 \begin {gather*} \frac {2 a^3 B d^3 n \log (a+b x)-2 b B c \left (b^2 c^2-3 a b c d+3 a^2 d^2\right ) n \log (c+d x)+b d x \left (2 a^2 d^2 (3 A+2 B n)+a b d (-6 B c n+6 A d x+B d n x)+b^2 \left (2 A d^2 x^2+B c n (2 c-d x)\right )+2 B d^2 \left (3 a^2+3 a b x+b^2 x^2\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{6 b d^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.33, size = 1323, normalized size = 11.71
method | result | size |
risch | \(\text {Expression too large to display}\) | \(1323\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 300 vs.
\(2 (106) = 212\).
time = 0.33, size = 300, normalized size = 2.65 \begin {gather*} \frac {1}{3} \, B b^{2} x^{3} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac {1}{3} \, A b^{2} x^{3} + B a b x^{2} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A a b x^{2} + {\left (\frac {a n e \log \left (b x + a\right )}{b} - \frac {c n e \log \left (d x + c\right )}{d}\right )} B a^{2} e^{\left (-1\right )} - {\left (\frac {a^{2} n e \log \left (b x + a\right )}{b^{2}} - \frac {c^{2} n e \log \left (d x + c\right )}{d^{2}} + \frac {{\left (b c n - a d n\right )} x e}{b d}\right )} B a b e^{\left (-1\right )} + \frac {1}{6} \, {\left (\frac {2 \, a^{3} n e \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} n e \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d n - a b d^{2} n\right )} x^{2} e - 2 \, {\left (b^{2} c^{2} n - a^{2} d^{2} n\right )} x e}{b^{2} d^{2}}\right )} B b^{2} e^{\left (-1\right )} + B a^{2} x \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A a^{2} x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 248 vs.
\(2 (106) = 212\).
time = 0.35, size = 248, normalized size = 2.19 \begin {gather*} \frac {2 \, {\left (A + B\right )} b^{3} d^{3} x^{3} + {\left (6 \, {\left (A + B\right )} a b^{2} d^{3} - {\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} n\right )} x^{2} + 2 \, {\left (3 \, {\left (A + B\right )} a^{2} b d^{3} + {\left (B b^{3} c^{2} d - 3 \, B a b^{2} c d^{2} + 2 \, B a^{2} b d^{3}\right )} n\right )} x + 2 \, {\left (B b^{3} d^{3} n x^{3} + 3 \, B a b^{2} d^{3} n x^{2} + 3 \, B a^{2} b d^{3} n x + B a^{3} d^{3} n\right )} \log \left (b x + a\right ) - 2 \, {\left (B b^{3} d^{3} n x^{3} + 3 \, B a b^{2} d^{3} n x^{2} + 3 \, B a^{2} b d^{3} n x + {\left (B b^{3} c^{3} - 3 \, B a b^{2} c^{2} d + 3 \, B a^{2} b c d^{2}\right )} n\right )} \log \left (d x + c\right )}{6 \, b d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: HeuristicGCDFailed} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 235 vs.
\(2 (106) = 212\).
time = 4.56, size = 235, normalized size = 2.08 \begin {gather*} \frac {B a^{3} n \log \left (b x + a\right )}{3 \, b} + \frac {1}{3} \, {\left (A b^{2} + B b^{2}\right )} x^{3} - \frac {{\left (B b^{2} c n - B a b d n - 6 \, A a b d - 6 \, B a b d\right )} x^{2}}{6 \, d} + \frac {1}{3} \, {\left (B b^{2} n x^{3} + 3 \, B a b n x^{2} + 3 \, B a^{2} n x\right )} \log \left (b x + a\right ) - \frac {1}{3} \, {\left (B b^{2} n x^{3} + 3 \, B a b n x^{2} + 3 \, B a^{2} n x\right )} \log \left (d x + c\right ) + \frac {{\left (B b^{2} c^{2} n - 3 \, B a b c d n + 2 \, B a^{2} d^{2} n + 3 \, A a^{2} d^{2} + 3 \, B a^{2} d^{2}\right )} x}{3 \, d^{2}} - \frac {{\left (B b^{2} c^{3} n - 3 \, B a b c^{2} d n + 3 \, B a^{2} c d^{2} n\right )} \log \left (-d x - c\right )}{3 \, d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.24, size = 262, normalized size = 2.32 \begin {gather*} \ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )\,\left (B\,a^2\,x+B\,a\,b\,x^2+\frac {B\,b^2\,x^3}{3}\right )+x^2\,\left (\frac {b\,\left (9\,A\,a\,d+3\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{6\,d}-\frac {A\,b\,\left (3\,a\,d+3\,b\,c\right )}{6\,d}\right )-x\,\left (\frac {\left (\frac {b\,\left (9\,A\,a\,d+3\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{3\,d}-\frac {A\,b\,\left (3\,a\,d+3\,b\,c\right )}{3\,d}\right )\,\left (3\,a\,d+3\,b\,c\right )}{3\,b\,d}-\frac {a\,\left (3\,A\,a\,d+3\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{d}+\frac {A\,a\,b\,c}{d}\right )+\frac {A\,b^2\,x^3}{3}-\frac {\ln \left (c+d\,x\right )\,\left (3\,B\,n\,a^2\,c\,d^2-3\,B\,n\,a\,b\,c^2\,d+B\,n\,b^2\,c^3\right )}{3\,d^3}+\frac {B\,a^3\,n\,\ln \left (a+b\,x\right )}{3\,b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________